package de.pass.ch.datastr;

public class PQueueNodeDynQuery extends PQueueNode {

	/**
	 * If this node u has been stalled, some path from the source to u has been
	 * found that is shorter than the key of u. The length of this path is
	 * stored in the 'stallKey'. If the node has not been stalled, the stallKey
	 * is 'infinity'.
	 */
	private int _stallKey;

	public PQueueNodeDynQuery() {
		super();
		unstall();
	}

	/**
	 * If this node u has been stalled, some path from the source to u has been
	 * found that is shorter than the key of u. The length of this path is
	 * stored in the 'stallKey'. If the node has not been stalled, the stallKey
	 * is 'infinity'.
	 */
	@Override
	public boolean stalled() {
		return (_stallKey != Integer.MAX_VALUE);
	}

	@Override
	public void unstall() {
		_stallKey = Integer.MAX_VALUE;
	}

	@Override
	public int stallKey() {
		return _stallKey;
	}

	@Override
	public void stallKey(int k) {
		_stallKey = k;
	}

}
